;---------------------------------
; read trascom site information
;---------------------------------
function transcom_lat(idebug)
begin

  lats = -88.
  latn =  88.

  filenama = "$KAILIBDATA_ROOT/transcom_sitelat.dat"

  alat = asciiread(filenama,-1,"float")
  alat = where(alat.lt.lats,lats,alat)
  alat = where(alat.gt.latn,latn,alat)

  if(idebug.eq.1) then 
     print("") 
     print("filename: "+filenama) 
     print("") 
     print("lat: "+alat) 
     print("") 
  end if 

return(alat)
end

;---------------------------------
function transcom_lon(idebug)
begin

  filenama = "$KAILIBDATA_ROOT/transcom_sitelon.dat"

  alon = asciiread(filenama,-1,"float")
  alon = where(alon.lt.0.,alon+360.,alon)

  if(idebug.eq.1) then
     print("")
     print("filename: "+filenama)
     print("")
     print("lon: "+alon)
     print("")
  end if

return(alon)
end

;---------------------------------
function transcom_hgt(idebug)
begin

  filenama = "$KAILIBDATA_ROOT/transcom_sitehgt.dat"

  ahgt = asciiread(filenama,-1,"float")

  if(idebug.eq.1) then
     print("")
     print("filename: "+filenama)
     print("")
     print("hgt: "+ahgt)
     print("")
  end if

return(ahgt)
end

;---------------------------------
function transcom_land(idebug)
begin

  filenama = "$KAILIBDATA_ROOT/transcom_siteland.dat"

  alnd = asciiread(filenama,-1,"integer")

  if(idebug.eq.1) then
     print("")
     print("filename: "+filenama)
     print("")
     print("land: "+alnd)
     print("")
  end if

return(alnd)
end

;---------------------------------
function transcom_absl(idebug)
begin

  filenama = "$KAILIBDATA_ROOT/transcom_siteabsl.dat"

  aslv = asciiread(filenama,-1,"integer")

  if(idebug.eq.1) then
     print("")
     print("filename: "+filenama)
     print("")
     print("absl: "+aslv)
     print("")
  end if

return(aslv)
end

;---------------------------------
function transcom_id(idebug)
begin

  filenama = "$KAILIBDATA_ROOT/transcom_siteland.dat"

  alnd = asciiread(filenama,-1,"integer")

  anum = alnd
  anum = 0

  ns = dimsizes(anum) 

  do is = 0, ns-1
     anum(is) = is + 1
  end do

  if(idebug.eq.1) then
     print("")
     print("filename: "+filenama)
     print("")
     print("id: "+anum)
     print("")
  end if

return(anum)
end



;---------------------------------
function transcom_ns(idebug)
begin

  filenama = "$KAILIBDATA_ROOT/transcom_siteland.dat"

  alnd = asciiread(filenama,-1,"integer")

  ns = dimsizes(alnd) 

  if(idebug.eq.1) then
     print("")
     print("filename: "+filenama)
     print("")
     print("nsite: "+ns)
     print("")
  end if

return(ns)
end


